package org.mcjug.locationmailer.util;

import android.content.Context;
import android.preference.PreferenceManager;

public class Constants {
	public static final String PREFS_LOCATION_UPDATE_INTERVAL_KEY = "locationUpdateInterval";
	public static final String PREFS_LOCATION_LIST_DISPLAY_SIZE_KEY = "locationListSize";
	public static final String PREFS_START_SENDING_EMAIL_KEY = "startSendingEmail";
	public static final String PREFS_SENDER_EMAIL_ADDRESS = "senderEmailAddress";

	public static final int LOCATION_UPDATE_INTERVAL_NONE = 0;
	public static final int LOCATION_LIST_DISPLAY_SIZE_DEFAULT = 10;

	public static String getProperty(Context context,
			int preferenceNameStringId, int defaultValueStringId) {
		String retval = null;

		String defaultValue = context.getString(defaultValueStringId);
		String preferenceName = context.getString(preferenceNameStringId);

		retval = PreferenceManager.getDefaultSharedPreferences(context)
				.getString(preferenceName, defaultValue);

		return retval;
	}
}
